function [ output_args ] = do_database(file,rgbhist,frames,descr, c_table, S_table )
%DO_DATABASE is used to insert colour feature and SIFT feature into datanase
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Input:
%file --- the absolute path of a picture on localhost
%rgbhist --- the 768 dimensions' colour feature
%frames --- the coordinate,scale and orient of a feature
%descr --- the descriptor of a feature
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%conn = database('project','cdb_outerroot','(19951227)','com.mysql.jdbc.Driver','jdbc:mysql://182.254.128.241:7707/project');
conn = database('test','root','','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3307/test');

res = exec(conn,['select id from pictures where url=' '''' file ''''] );
res = fetch(res);
res = res.Data()

res = cell2mat(res)
picture_id = res(1)


set(conn,'AutoCommit','off');
%insert colour feature
fastinsert(conn,c_table,{'picid',...
'_1desc1','_1desc2','_1desc3','_1desc4','_1desc5','_1desc6','_1desc7','_1desc8',...
'_1desc9','_1desc10','_1desc11','_1desc12','_1desc13','_1desc14','_1desc15','_1desc16',...
'_1desc17','_1desc18','_1desc19','_1desc20','_1desc21','_1desc22','_1desc23','_1desc24',...
'_1desc25','_1desc26','_1desc27','_1desc28','_1desc29','_1desc30','_1desc31','_1desc32',...
'_1desc33','_1desc34','_1desc35','_1desc36','_1desc37','_1desc38','_1desc39','_1desc40',...
'_1desc41','_1desc42','_1desc43','_1desc44','_1desc45','_1desc46','_1desc47','_1desc48',...
'_1desc49','_1desc50','_1desc51','_1desc52','_1desc53','_1desc54','_1desc55','_1desc56',...
'_1desc57','_1desc58','_1desc59','_1desc60','_1desc61','_1desc62','_1desc63','_1desc64',...
'_1desc65','_1desc66','_1desc67','_1desc68','_1desc69','_1desc70','_1desc71','_1desc72',...
'_1desc73','_1desc74','_1desc75','_1desc76','_1desc77','_1desc78','_1desc79','_1desc80',...
'_1desc81','_1desc82','_1desc83','_1desc84','_1desc85','_1desc86','_1desc87','_1desc88',...
'_1desc89','_1desc90','_1desc91','_1desc92','_1desc93','_1desc94','_1desc95','_1desc96',...
'_1desc97','_1desc98','_1desc99','_1desc100','_1desc101','_1desc102','_1desc103','_1desc104',...
'_1desc105','_1desc106','_1desc107','_1desc108','_1desc109','_1desc110','_1desc111','_1desc112',...
'_1desc113','_1desc114','_1desc115','_1desc116','_1desc117','_1desc118','_1desc119','_1desc120',...
'_1desc121','_1desc122','_1desc123','_1desc124','_1desc125','_1desc126','_1desc127','_1desc128',...
'_1desc129','_1desc130','_1desc131','_1desc132','_1desc133','_1desc134','_1desc135','_1desc136',...
'_1desc137','_1desc138','_1desc139','_1desc140','_1desc141','_1desc142','_1desc143','_1desc144',...
'_1desc145','_1desc146','_1desc147','_1desc148','_1desc149','_1desc150','_1desc151','_1desc152',...
'_1desc153','_1desc154','_1desc155','_1desc156','_1desc157','_1desc158','_1desc159','_1desc160',...
'_1desc161','_1desc162','_1desc163','_1desc164','_1desc165','_1desc166','_1desc167','_1desc168',...
'_1desc169','_1desc170','_1desc171','_1desc172','_1desc173','_1desc174','_1desc175','_1desc176',...
'_1desc177','_1desc178','_1desc179','_1desc180','_1desc181','_1desc182','_1desc183','_1desc184',...
'_1desc185','_1desc186','_1desc187','_1desc188','_1desc189','_1desc190','_1desc191','_1desc192',...
'_1desc193','_1desc194','_1desc195','_1desc196','_1desc197','_1desc198','_1desc199','_1desc200',...
'_1desc201','_1desc202','_1desc203','_1desc204','_1desc205','_1desc206','_1desc207','_1desc208',...
'_1desc209','_1desc210','_1desc211','_1desc212','_1desc213','_1desc214','_1desc215','_1desc216',...
'_1desc217','_1desc218','_1desc219','_1desc220','_1desc221','_1desc222','_1desc223','_1desc224',...
'_1desc225','_1desc226','_1desc227','_1desc228','_1desc229','_1desc230','_1desc231','_1desc232',...
'_1desc233','_1desc234','_1desc235','_1desc236','_1desc237','_1desc238','_1desc239','_1desc240',...
'_1desc241','_1desc242','_1desc243','_1desc244','_1desc245','_1desc246','_1desc247','_1desc248',...
'_1desc249','_1desc250','_1desc251','_1desc252','_1desc253','_1desc254','_1desc255','_1desc256',...
'_2desc1','_2desc2','_2desc3','_2desc4','_2desc5','_2desc6','_2desc7','_2desc8',...
'_2desc9','_2desc10','_2desc11','_2desc12','_2desc13','_2desc14','_2desc15','_2desc16',...
'_2desc17','_2desc18','_2desc19','_2desc20','_2desc21','_2desc22','_2desc23','_2desc24',...
'_2desc25','_2desc26','_2desc27','_2desc28','_2desc29','_2desc30','_2desc31','_2desc32',...
'_2desc33','_2desc34','_2desc35','_2desc36','_2desc37','_2desc38','_2desc39','_2desc40',...
'_2desc41','_2desc42','_2desc43','_2desc44','_2desc45','_2desc46','_2desc47','_2desc48',...
'_2desc49','_2desc50','_2desc51','_2desc52','_2desc53','_2desc54','_2desc55','_2desc56',...
'_2desc57','_2desc58','_2desc59','_2desc60','_2desc61','_2desc62','_2desc63','_2desc64',...
'_2desc65','_2desc66','_2desc67','_2desc68','_2desc69','_2desc70','_2desc71','_2desc72',...
'_2desc73','_2desc74','_2desc75','_2desc76','_2desc77','_2desc78','_2desc79','_2desc80',...
'_2desc81','_2desc82','_2desc83','_2desc84','_2desc85','_2desc86','_2desc87','_2desc88',...
'_2desc89','_2desc90','_2desc91','_2desc92','_2desc93','_2desc94','_2desc95','_2desc96',...
'_2desc97','_2desc98','_2desc99','_2desc100','_2desc101','_2desc102','_2desc103','_2desc104',...
'_2desc105','_2desc106','_2desc107','_2desc108','_2desc109','_2desc110','_2desc111','_2desc112',...
'_2desc113','_2desc114','_2desc115','_2desc116','_2desc117','_2desc118','_2desc119','_2desc120',...
'_2desc121','_2desc122','_2desc123','_2desc124','_2desc125','_2desc126','_2desc127','_2desc128',...
'_2desc129','_2desc130','_2desc131','_2desc132','_2desc133','_2desc134','_2desc135','_2desc136',...
'_2desc137','_2desc138','_2desc139','_2desc140','_2desc141','_2desc142','_2desc143','_2desc144',...
'_2desc145','_2desc146','_2desc147','_2desc148','_2desc149','_2desc150','_2desc151','_2desc152',...
'_2desc153','_2desc154','_2desc155','_2desc156','_2desc157','_2desc158','_2desc159','_2desc160',...
'_2desc161','_2desc162','_2desc163','_2desc164','_2desc165','_2desc166','_2desc167','_2desc168',...
'_2desc169','_2desc170','_2desc171','_2desc172','_2desc173','_2desc174','_2desc175','_2desc176',...
'_2desc177','_2desc178','_2desc179','_2desc180','_2desc181','_2desc182','_2desc183','_2desc184',...
'_2desc185','_2desc186','_2desc187','_2desc188','_2desc189','_2desc190','_2desc191','_2desc192',...
'_2desc193','_2desc194','_2desc195','_2desc196','_2desc197','_2desc198','_2desc199','_2desc200',...
'_2desc201','_2desc202','_2desc203','_2desc204','_2desc205','_2desc206','_2desc207','_2desc208',...
'_2desc209','_2desc210','_2desc211','_2desc212','_2desc213','_2desc214','_2desc215','_2desc216',...
'_2desc217','_2desc218','_2desc219','_2desc220','_2desc221','_2desc222','_2desc223','_2desc224',...
'_2desc225','_2desc226','_2desc227','_2desc228','_2desc229','_2desc230','_2desc231','_2desc232',...
'_2desc233','_2desc234','_2desc235','_2desc236','_2desc237','_2desc238','_2desc239','_2desc240',...
'_2desc241','_2desc242','_2desc243','_2desc244','_2desc245','_2desc246','_2desc247','_2desc248',...
'_2desc249','_2desc250','_2desc251','_2desc252','_2desc253','_2desc254','_2desc255','_2desc256',...
'_3desc1','_3desc2','_3desc3','_3desc4','_3desc5','_3desc6','_3desc7','_3desc8',...
'_3desc9','_3desc10','_3desc11','_3desc12','_3desc13','_3desc14','_3desc15','_3desc16',...
'_3desc17','_3desc18','_3desc19','_3desc20','_3desc21','_3desc22','_3desc23','_3desc24',...
'_3desc25','_3desc26','_3desc27','_3desc28','_3desc29','_3desc30','_3desc31','_3desc32',...
'_3desc33','_3desc34','_3desc35','_3desc36','_3desc37','_3desc38','_3desc39','_3desc40',...
'_3desc41','_3desc42','_3desc43','_3desc44','_3desc45','_3desc46','_3desc47','_3desc48',...
'_3desc49','_3desc50','_3desc51','_3desc52','_3desc53','_3desc54','_3desc55','_3desc56',...
'_3desc57','_3desc58','_3desc59','_3desc60','_3desc61','_3desc62','_3desc63','_3desc64',...
'_3desc65','_3desc66','_3desc67','_3desc68','_3desc69','_3desc70','_3desc71','_3desc72',...
'_3desc73','_3desc74','_3desc75','_3desc76','_3desc77','_3desc78','_3desc79','_3desc80',...
'_3desc81','_3desc82','_3desc83','_3desc84','_3desc85','_3desc86','_3desc87','_3desc88',...
'_3desc89','_3desc90','_3desc91','_3desc92','_3desc93','_3desc94','_3desc95','_3desc96',...
'_3desc97','_3desc98','_3desc99','_3desc100','_3desc101','_3desc102','_3desc103','_3desc104',...
'_3desc105','_3desc106','_3desc107','_3desc108','_3desc109','_3desc110','_3desc111','_3desc112',...
'_3desc113','_3desc114','_3desc115','_3desc116','_3desc117','_3desc118','_3desc119','_3desc120',...
'_3desc121','_3desc122','_3desc123','_3desc124','_3desc125','_3desc126','_3desc127','_3desc128',...
'_3desc129','_3desc130','_3desc131','_3desc132','_3desc133','_3desc134','_3desc135','_3desc136',...
'_3desc137','_3desc138','_3desc139','_3desc140','_3desc141','_3desc142','_3desc143','_3desc144',...
'_3desc145','_3desc146','_3desc147','_3desc148','_3desc149','_3desc150','_3desc151','_3desc152',...
'_3desc153','_3desc154','_3desc155','_3desc156','_3desc157','_3desc158','_3desc159','_3desc160',...
'_3desc161','_3desc162','_3desc163','_3desc164','_3desc165','_3desc166','_3desc167','_3desc168',...
'_3desc169','_3desc170','_3desc171','_3desc172','_3desc173','_3desc174','_3desc175','_3desc176',...
'_3desc177','_3desc178','_3desc179','_3desc180','_3desc181','_3desc182','_3desc183','_3desc184',...
'_3desc185','_3desc186','_3desc187','_3desc188','_3desc189','_3desc190','_3desc191','_3desc192',...
'_3desc193','_3desc194','_3desc195','_3desc196','_3desc197','_3desc198','_3desc199','_3desc200',...
'_3desc201','_3desc202','_3desc203','_3desc204','_3desc205','_3desc206','_3desc207','_3desc208',...
'_3desc209','_3desc210','_3desc211','_3desc212','_3desc213','_3desc214','_3desc215','_3desc216',...
'_3desc217','_3desc218','_3desc219','_3desc220','_3desc221','_3desc222','_3desc223','_3desc224',...
'_3desc225','_3desc226','_3desc227','_3desc228','_3desc229','_3desc230','_3desc231','_3desc232',...
'_3desc233','_3desc234','_3desc235','_3desc236','_3desc237','_3desc238','_3desc239','_3desc240',...
'_3desc241','_3desc242','_3desc243','_3desc244','_3desc245','_3desc246','_3desc247','_3desc248',...
'_3desc249','_3desc250','_3desc251','_3desc252','_3desc253','_3desc254','_3desc255','_3desc256'   
},[
picture_id...
rgbhist(1) rgbhist(2) rgbhist(3) rgbhist(4) rgbhist(5) rgbhist(6) rgbhist(7) rgbhist(8)...
rgbhist(9) rgbhist(10) rgbhist(11) rgbhist(12) rgbhist(13) rgbhist(14) rgbhist(15) rgbhist(16)...
rgbhist(17) rgbhist(18) rgbhist(19) rgbhist(20) rgbhist(21) rgbhist(22) rgbhist(23) rgbhist(24)...
rgbhist(25) rgbhist(26) rgbhist(27) rgbhist(28) rgbhist(29) rgbhist(30) rgbhist(31) rgbhist(32)...
rgbhist(33) rgbhist(34) rgbhist(35) rgbhist(36) rgbhist(37) rgbhist(38) rgbhist(39) rgbhist(40)...
rgbhist(41) rgbhist(42) rgbhist(43) rgbhist(44) rgbhist(45) rgbhist(46) rgbhist(47) rgbhist(48)...
rgbhist(49) rgbhist(50) rgbhist(51) rgbhist(52) rgbhist(53) rgbhist(54) rgbhist(55) rgbhist(56)...
rgbhist(57) rgbhist(58) rgbhist(59) rgbhist(60) rgbhist(61) rgbhist(62) rgbhist(63) rgbhist(64)...
rgbhist(65) rgbhist(66) rgbhist(67) rgbhist(68) rgbhist(69) rgbhist(70) rgbhist(71) rgbhist(72)...
rgbhist(73) rgbhist(74) rgbhist(75) rgbhist(76) rgbhist(77) rgbhist(78) rgbhist(79) rgbhist(80)...
rgbhist(81) rgbhist(82) rgbhist(83) rgbhist(84) rgbhist(85) rgbhist(86) rgbhist(87) rgbhist(88)...
rgbhist(89) rgbhist(90) rgbhist(91) rgbhist(92) rgbhist(93) rgbhist(94) rgbhist(95) rgbhist(96)...
rgbhist(97) rgbhist(98) rgbhist(99) rgbhist(100) rgbhist(101) rgbhist(102) rgbhist(103) rgbhist(104)...
rgbhist(105) rgbhist(106) rgbhist(107) rgbhist(108) rgbhist(109) rgbhist(110) rgbhist(111) rgbhist(112)...
rgbhist(113) rgbhist(114) rgbhist(115) rgbhist(116) rgbhist(117) rgbhist(118) rgbhist(119) rgbhist(120)...
rgbhist(121) rgbhist(122) rgbhist(123) rgbhist(124) rgbhist(125) rgbhist(126) rgbhist(127) rgbhist(128)...
rgbhist(129) rgbhist(130) rgbhist(131) rgbhist(132) rgbhist(133) rgbhist(134) rgbhist(135) rgbhist(136)...
rgbhist(137) rgbhist(138) rgbhist(139) rgbhist(140) rgbhist(141) rgbhist(142) rgbhist(143) rgbhist(144)...
rgbhist(145) rgbhist(146) rgbhist(147) rgbhist(148) rgbhist(149) rgbhist(150) rgbhist(151) rgbhist(152)...
rgbhist(153) rgbhist(154) rgbhist(155) rgbhist(156) rgbhist(157) rgbhist(158) rgbhist(159) rgbhist(160)...
rgbhist(161) rgbhist(162) rgbhist(163) rgbhist(164) rgbhist(165) rgbhist(166) rgbhist(167) rgbhist(168)...
rgbhist(169) rgbhist(170) rgbhist(171) rgbhist(172) rgbhist(173) rgbhist(174) rgbhist(175) rgbhist(176)...
rgbhist(177) rgbhist(178) rgbhist(179) rgbhist(180) rgbhist(181) rgbhist(182) rgbhist(183) rgbhist(184)...
rgbhist(185) rgbhist(186) rgbhist(187) rgbhist(188) rgbhist(189) rgbhist(190) rgbhist(191) rgbhist(192)...
rgbhist(193) rgbhist(194) rgbhist(195) rgbhist(196) rgbhist(197) rgbhist(198) rgbhist(199) rgbhist(200)...
rgbhist(201) rgbhist(202) rgbhist(203) rgbhist(204) rgbhist(205) rgbhist(206) rgbhist(207) rgbhist(208)...
rgbhist(209) rgbhist(210) rgbhist(211) rgbhist(212) rgbhist(213) rgbhist(214) rgbhist(215) rgbhist(216)...
rgbhist(217) rgbhist(218) rgbhist(219) rgbhist(220) rgbhist(221) rgbhist(222) rgbhist(223) rgbhist(224)...
rgbhist(225) rgbhist(226) rgbhist(227) rgbhist(228) rgbhist(229) rgbhist(230) rgbhist(231) rgbhist(232)...
rgbhist(233) rgbhist(234) rgbhist(235) rgbhist(236) rgbhist(237) rgbhist(238) rgbhist(239) rgbhist(240)...
rgbhist(241) rgbhist(242) rgbhist(243) rgbhist(244) rgbhist(245) rgbhist(246) rgbhist(247) rgbhist(248)...
rgbhist(249) rgbhist(250) rgbhist(251) rgbhist(252) rgbhist(253) rgbhist(254) rgbhist(255) rgbhist(256)...
rgbhist(257) rgbhist(258) rgbhist(259) rgbhist(260) rgbhist(261) rgbhist(262) rgbhist(263) rgbhist(264)...
rgbhist(265) rgbhist(266) rgbhist(267) rgbhist(268) rgbhist(269) rgbhist(270) rgbhist(271) rgbhist(272)...
rgbhist(273) rgbhist(274) rgbhist(275) rgbhist(276) rgbhist(277) rgbhist(278) rgbhist(279) rgbhist(280)...
rgbhist(281) rgbhist(282) rgbhist(283) rgbhist(284) rgbhist(285) rgbhist(286) rgbhist(287) rgbhist(288)...
rgbhist(289) rgbhist(290) rgbhist(291) rgbhist(292) rgbhist(293) rgbhist(294) rgbhist(295) rgbhist(296)...
rgbhist(297) rgbhist(298) rgbhist(299) rgbhist(300) rgbhist(301) rgbhist(302) rgbhist(303) rgbhist(304)...
rgbhist(305) rgbhist(306) rgbhist(307) rgbhist(308) rgbhist(309) rgbhist(310) rgbhist(311) rgbhist(312)...
rgbhist(313) rgbhist(314) rgbhist(315) rgbhist(316) rgbhist(317) rgbhist(318) rgbhist(319) rgbhist(320)...
rgbhist(321) rgbhist(322) rgbhist(323) rgbhist(324) rgbhist(325) rgbhist(326) rgbhist(327) rgbhist(328)...
rgbhist(329) rgbhist(330) rgbhist(331) rgbhist(332) rgbhist(333) rgbhist(334) rgbhist(335) rgbhist(336)...
rgbhist(337) rgbhist(338) rgbhist(339) rgbhist(340) rgbhist(341) rgbhist(342) rgbhist(343) rgbhist(344)...
rgbhist(345) rgbhist(346) rgbhist(347) rgbhist(348) rgbhist(349) rgbhist(350) rgbhist(351) rgbhist(352)...
rgbhist(353) rgbhist(354) rgbhist(355) rgbhist(356) rgbhist(357) rgbhist(358) rgbhist(359) rgbhist(360)...
rgbhist(361) rgbhist(362) rgbhist(363) rgbhist(364) rgbhist(365) rgbhist(366) rgbhist(367) rgbhist(368)...
rgbhist(369) rgbhist(370) rgbhist(371) rgbhist(372) rgbhist(373) rgbhist(374) rgbhist(375) rgbhist(376)...
rgbhist(377) rgbhist(378) rgbhist(379) rgbhist(380) rgbhist(381) rgbhist(382) rgbhist(383) rgbhist(384)...
rgbhist(385) rgbhist(386) rgbhist(387) rgbhist(388) rgbhist(389) rgbhist(390) rgbhist(391) rgbhist(392)...
rgbhist(393) rgbhist(394) rgbhist(395) rgbhist(396) rgbhist(397) rgbhist(398) rgbhist(399) rgbhist(400)...
rgbhist(401) rgbhist(402) rgbhist(403) rgbhist(404) rgbhist(405) rgbhist(406) rgbhist(407) rgbhist(408)...
rgbhist(409) rgbhist(410) rgbhist(411) rgbhist(412) rgbhist(413) rgbhist(414) rgbhist(415) rgbhist(416)...
rgbhist(417) rgbhist(418) rgbhist(419) rgbhist(420) rgbhist(421) rgbhist(422) rgbhist(423) rgbhist(424)...
rgbhist(425) rgbhist(426) rgbhist(427) rgbhist(428) rgbhist(429) rgbhist(430) rgbhist(431) rgbhist(432)...
rgbhist(433) rgbhist(434) rgbhist(435) rgbhist(436) rgbhist(437) rgbhist(438) rgbhist(439) rgbhist(440)...
rgbhist(441) rgbhist(442) rgbhist(443) rgbhist(444) rgbhist(445) rgbhist(446) rgbhist(447) rgbhist(448)...
rgbhist(449) rgbhist(450) rgbhist(451) rgbhist(452) rgbhist(453) rgbhist(454) rgbhist(455) rgbhist(456)...
rgbhist(457) rgbhist(458) rgbhist(459) rgbhist(460) rgbhist(461) rgbhist(462) rgbhist(463) rgbhist(464)...
rgbhist(465) rgbhist(466) rgbhist(467) rgbhist(468) rgbhist(469) rgbhist(470) rgbhist(471) rgbhist(472)...
rgbhist(473) rgbhist(474) rgbhist(475) rgbhist(476) rgbhist(477) rgbhist(478) rgbhist(479) rgbhist(480)...
rgbhist(481) rgbhist(482) rgbhist(483) rgbhist(484) rgbhist(485) rgbhist(486) rgbhist(487) rgbhist(488)...
rgbhist(489) rgbhist(490) rgbhist(491) rgbhist(492) rgbhist(493) rgbhist(494) rgbhist(495) rgbhist(496)...
rgbhist(497) rgbhist(498) rgbhist(499) rgbhist(500) rgbhist(501) rgbhist(502) rgbhist(503) rgbhist(504)...
rgbhist(505) rgbhist(506) rgbhist(507) rgbhist(508) rgbhist(509) rgbhist(510) rgbhist(511) rgbhist(512)...
rgbhist(513) rgbhist(514) rgbhist(515) rgbhist(516) rgbhist(517) rgbhist(518) rgbhist(519) rgbhist(520)...
rgbhist(521) rgbhist(522) rgbhist(523) rgbhist(524) rgbhist(525) rgbhist(526) rgbhist(527) rgbhist(528)...
rgbhist(529) rgbhist(530) rgbhist(531) rgbhist(532) rgbhist(533) rgbhist(534) rgbhist(535) rgbhist(536)...
rgbhist(537) rgbhist(538) rgbhist(539) rgbhist(540) rgbhist(541) rgbhist(542) rgbhist(543) rgbhist(544)...
rgbhist(545) rgbhist(546) rgbhist(547) rgbhist(548) rgbhist(549) rgbhist(550) rgbhist(551) rgbhist(552)...
rgbhist(553) rgbhist(554) rgbhist(555) rgbhist(556) rgbhist(557) rgbhist(558) rgbhist(559) rgbhist(560)...
rgbhist(561) rgbhist(562) rgbhist(563) rgbhist(564) rgbhist(565) rgbhist(566) rgbhist(567) rgbhist(568)...
rgbhist(569) rgbhist(570) rgbhist(571) rgbhist(572) rgbhist(573) rgbhist(574) rgbhist(575) rgbhist(576)...
rgbhist(577) rgbhist(578) rgbhist(579) rgbhist(580) rgbhist(581) rgbhist(582) rgbhist(583) rgbhist(584)...
rgbhist(585) rgbhist(586) rgbhist(587) rgbhist(588) rgbhist(589) rgbhist(590) rgbhist(591) rgbhist(592)...
rgbhist(593) rgbhist(594) rgbhist(595) rgbhist(596) rgbhist(597) rgbhist(598) rgbhist(599) rgbhist(600)...
rgbhist(601) rgbhist(602) rgbhist(603) rgbhist(604) rgbhist(605) rgbhist(606) rgbhist(607) rgbhist(608)...
rgbhist(609) rgbhist(610) rgbhist(611) rgbhist(612) rgbhist(613) rgbhist(614) rgbhist(615) rgbhist(616)...
rgbhist(617) rgbhist(618) rgbhist(619) rgbhist(620) rgbhist(621) rgbhist(622) rgbhist(623) rgbhist(624)...
rgbhist(625) rgbhist(626) rgbhist(627) rgbhist(628) rgbhist(629) rgbhist(630) rgbhist(631) rgbhist(632)...
rgbhist(633) rgbhist(634) rgbhist(635) rgbhist(636) rgbhist(637) rgbhist(638) rgbhist(639) rgbhist(640)...
rgbhist(641) rgbhist(642) rgbhist(643) rgbhist(644) rgbhist(645) rgbhist(646) rgbhist(647) rgbhist(648)...
rgbhist(649) rgbhist(650) rgbhist(651) rgbhist(652) rgbhist(653) rgbhist(654) rgbhist(655) rgbhist(656)...
rgbhist(657) rgbhist(658) rgbhist(659) rgbhist(660) rgbhist(661) rgbhist(662) rgbhist(663) rgbhist(664)...
rgbhist(665) rgbhist(666) rgbhist(667) rgbhist(668) rgbhist(669) rgbhist(670) rgbhist(671) rgbhist(672)...
rgbhist(673) rgbhist(674) rgbhist(675) rgbhist(676) rgbhist(677) rgbhist(678) rgbhist(679) rgbhist(680)...
rgbhist(681) rgbhist(682) rgbhist(683) rgbhist(684) rgbhist(685) rgbhist(686) rgbhist(687) rgbhist(688)...
rgbhist(689) rgbhist(690) rgbhist(691) rgbhist(692) rgbhist(693) rgbhist(694) rgbhist(695) rgbhist(696)...
rgbhist(697) rgbhist(698) rgbhist(699) rgbhist(700) rgbhist(701) rgbhist(702) rgbhist(703) rgbhist(704)...
rgbhist(705) rgbhist(706) rgbhist(707) rgbhist(708) rgbhist(709) rgbhist(710) rgbhist(711) rgbhist(712)...
rgbhist(713) rgbhist(714) rgbhist(715) rgbhist(716) rgbhist(717) rgbhist(718) rgbhist(719) rgbhist(720)...
rgbhist(721) rgbhist(722) rgbhist(723) rgbhist(724) rgbhist(725) rgbhist(726) rgbhist(727) rgbhist(728)...
rgbhist(729) rgbhist(730) rgbhist(731) rgbhist(732) rgbhist(733) rgbhist(734) rgbhist(735) rgbhist(736)...
rgbhist(737) rgbhist(738) rgbhist(739) rgbhist(740) rgbhist(741) rgbhist(742) rgbhist(743) rgbhist(744)...
rgbhist(745) rgbhist(746) rgbhist(747) rgbhist(748) rgbhist(749) rgbhist(750) rgbhist(751) rgbhist(752)...
rgbhist(753) rgbhist(754) rgbhist(755) rgbhist(756) rgbhist(757) rgbhist(758) rgbhist(759) rgbhist(760)...
rgbhist(761) rgbhist(762) rgbhist(763) rgbhist(764) rgbhist(765) rgbhist(766) rgbhist(767) rgbhist(768)]);
commit(conn);
%insert SIFT feature
remainder = mod(size(frames,2),2);
for index = 1:2:(size(frames,2)-remainder)
    fastinsert(conn,S_table , {
    'picid','posx','posy','scale','orient',...
    'desc1','desc2','desc3','desc4','desc5','desc6','desc7','desc8',...
    'desc9','desc10','desc11','desc12','desc13','desc14','desc15','desc16',...
    'desc17','desc18','desc19','desc20','desc21','desc22','desc23','desc24',...
    'desc25','desc26','desc27','desc28','desc29','desc30','desc31','desc32',...
    'desc33','desc34','desc35','desc36','desc37','desc38','desc39','desc40',...
    'desc41','desc42','desc43','desc44','desc45','desc46','desc47','desc48',...
    'desc49','desc50','desc51','desc52','desc53','desc54','desc55','desc56',...
    'desc57','desc58','desc59','desc60','desc61','desc62','desc63','desc64',...
    'desc65','desc66','desc67','desc68','desc69','desc70','desc71','desc72',...
    'desc73','desc74','desc75','desc76','desc77','desc78','desc79','desc80',...
    'desc81','desc82','desc83','desc84','desc85','desc86','desc87','desc88',...
    'desc89','desc90','desc91','desc92','desc93','desc94','desc95','desc96',...
    'desc97','desc98','desc99','desc100','desc101','desc102','desc103','desc104',...
    'desc105','desc106','desc107','desc108','desc109','desc110','desc111','desc112',...
    'desc113','desc114','desc115','desc116','desc117','desc118','desc119','desc120',...
    'desc121','desc122','desc123','desc124','desc125','desc126','desc127','desc128'},[
    picture_id frames(1,index) frames(2,index) frames(3,index) frames(4,index)...
    descr(1,index) descr(2,index) descr(3,index) descr(4,index) descr(5,index) descr(6,index) descr(7,index) descr(8,index)...
    descr(9,index) descr(10,index) descr(11,index) descr(12,index) descr(13,index) descr(14,index) descr(15,index) descr(16,index)...
    descr(17,index) descr(18,index) descr(19,index) descr(20,index) descr(21,index) descr(22,index) descr(23,index) descr(24,index)...
    descr(25,index) descr(26,index) descr(27,index) descr(28,index) descr(29,index) descr(30,index) descr(31,index) descr(32,index)...
    descr(33,index) descr(34,index) descr(35,index) descr(36,index) descr(37,index) descr(38,index) descr(39,index) descr(40,index)...
    descr(41,index) descr(42,index) descr(43,index) descr(44,index) descr(45,index) descr(46,index) descr(47,index) descr(48,index)...
    descr(49,index) descr(50,index) descr(51,index) descr(52,index) descr(53,index) descr(54,index) descr(55,index) descr(56,index)...
    descr(57,index) descr(58,index) descr(59,index) descr(60,index) descr(61,index) descr(62,index) descr(63,index) descr(64,index)...
    descr(65,index) descr(66,index) descr(67,index) descr(68,index) descr(69,index) descr(70,index) descr(71,index) descr(72,index)...
    descr(73,index) descr(74,index) descr(75,index) descr(76,index) descr(77,index) descr(78,index) descr(79,index) descr(80,index)...
    descr(81,index) descr(82,index) descr(83,index) descr(84,index) descr(85,index) descr(86,index) descr(87,index) descr(88,index)...
    descr(89,index) descr(90,index) descr(91,index) descr(92,index) descr(93,index) descr(94,index) descr(95,index) descr(96,index)...
    descr(97,index) descr(98,index) descr(99,index) descr(100,index) descr(101,index) descr(102,index) descr(103,index) descr(104,index)...
    descr(105,index) descr(106,index) descr(107,index) descr(108,index) descr(109,index) descr(110,index) descr(111,index) descr(112,index)...
    descr(113,index) descr(114,index) descr(115,index) descr(116,index) descr(117,index) descr(118,index) descr(119,index) descr(120,index)...
    descr(121,index) descr(122,index) descr(123,index) descr(124,index) descr(125,index) descr(126,index) descr(127,index) descr(128,index);
    picture_id frames(1,index+1) frames(2,index+1) frames(3,index+1) frames(4,index+1)...
    descr(1,index+1) descr(2,index+1) descr(3,index+1) descr(4,index+1) descr(5,index+1) descr(6,index+1) descr(7,index+1) descr(8,index+1)...
    descr(9,index+1) descr(10,index+1) descr(11,index+1) descr(12,index+1) descr(13,index+1) descr(14,index+1) descr(15,index+1) descr(16,index+1)...
    descr(17,index+1) descr(18,index+1) descr(19,index+1) descr(20,index+1) descr(21,index+1) descr(22,index+1) descr(23,index+1) descr(24,index+1)...
    descr(25,index+1) descr(26,index+1) descr(27,index+1) descr(28,index+1) descr(29,index+1) descr(30,index+1) descr(31,index+1) descr(32,index+1)...
    descr(33,index+1) descr(34,index+1) descr(35,index+1) descr(36,index+1) descr(37,index+1) descr(38,index+1) descr(39,index+1) descr(40,index+1)...
    descr(41,index+1) descr(42,index+1) descr(43,index+1) descr(44,index+1) descr(45,index+1) descr(46,index+1) descr(47,index+1) descr(48,index+1)...
    descr(49,index+1) descr(50,index+1) descr(51,index+1) descr(52,index+1) descr(53,index+1) descr(54,index+1) descr(55,index+1) descr(56,index+1)...
    descr(57,index+1) descr(58,index+1) descr(59,index+1) descr(60,index+1) descr(61,index+1) descr(62,index+1) descr(63,index+1) descr(64,index+1)...
    descr(65,index+1) descr(66,index+1) descr(67,index+1) descr(68,index+1) descr(69,index+1) descr(70,index+1) descr(71,index+1) descr(72,index+1)...
    descr(73,index+1) descr(74,index+1) descr(75,index+1) descr(76,index+1) descr(77,index+1) descr(78,index+1) descr(79,index+1) descr(80,index+1)...
    descr(81,index+1) descr(82,index+1) descr(83,index+1) descr(84,index+1) descr(85,index+1) descr(86,index+1) descr(87,index+1) descr(88,index+1)...
    descr(89,index+1) descr(90,index+1) descr(91,index+1) descr(92,index+1) descr(93,index+1) descr(94,index+1) descr(95,index+1) descr(96,index+1)...
    descr(97,index+1) descr(98,index+1) descr(99,index+1) descr(100,index+1) descr(101,index+1) descr(102,index+1) descr(103,index+1) descr(104,index+1)...
    descr(105,index+1) descr(106,index+1) descr(107,index+1) descr(108,index+1) descr(109,index+1) descr(110,index+1) descr(111,index+1) descr(112,index+1)...
    descr(113,index+1) descr(114,index+1) descr(115,index+1) descr(116,index+1) descr(117,index+1) descr(118,index+1) descr(119,index+1) descr(120,index+1)...
    descr(121,index+1) descr(122,index+1) descr(123,index+1) descr(124,index+1) descr(125,index+1) descr(126,index+1) descr(127,index+1) descr(128,index+1)]);
    commit(conn);
end
if remainder == 1
    index = size(frames,2);
    fastinsert(conn, S_table , {
    'picid','posx','posy','scale','orient',...
    'desc1','desc2','desc3','desc4','desc5','desc6','desc7','desc8',...
    'desc9','desc10','desc11','desc12','desc13','desc14','desc15','desc16',...
    'desc17','desc18','desc19','desc20','desc21','desc22','desc23','desc24',...
    'desc25','desc26','desc27','desc28','desc29','desc30','desc31','desc32',...
    'desc33','desc34','desc35','desc36','desc37','desc38','desc39','desc40',...
    'desc41','desc42','desc43','desc44','desc45','desc46','desc47','desc48',...
    'desc49','desc50','desc51','desc52','desc53','desc54','desc55','desc56',...
    'desc57','desc58','desc59','desc60','desc61','desc62','desc63','desc64',...
    'desc65','desc66','desc67','desc68','desc69','desc70','desc71','desc72',...
    'desc73','desc74','desc75','desc76','desc77','desc78','desc79','desc80',...
    'desc81','desc82','desc83','desc84','desc85','desc86','desc87','desc88',...
    'desc89','desc90','desc91','desc92','desc93','desc94','desc95','desc96',...
    'desc97','desc98','desc99','desc100','desc101','desc102','desc103','desc104',...
    'desc105','desc106','desc107','desc108','desc109','desc110','desc111','desc112',...
    'desc113','desc114','desc115','desc116','desc117','desc118','desc119','desc120',...
    'desc121','desc122','desc123','desc124','desc125','desc126','desc127','desc128'},[
    picture_id frames(1,index) frames(2,index) frames(3,index) frames(4,index)...
    descr(1,index) descr(2,index) descr(3,index) descr(4,index) descr(5,index) descr(6,index) descr(7,index) descr(8,index)...
    descr(9,index) descr(10,index) descr(11,index) descr(12,index) descr(13,index) descr(14,index) descr(15,index) descr(16,index)...
    descr(17,index) descr(18,index) descr(19,index) descr(20,index) descr(21,index) descr(22,index) descr(23,index) descr(24,index)...
    descr(25,index) descr(26,index) descr(27,index) descr(28,index) descr(29,index) descr(30,index) descr(31,index) descr(32,index)...
    descr(33,index) descr(34,index) descr(35,index) descr(36,index) descr(37,index) descr(38,index) descr(39,index) descr(40,index)...
    descr(41,index) descr(42,index) descr(43,index) descr(44,index) descr(45,index) descr(46,index) descr(47,index) descr(48,index)...
    descr(49,index) descr(50,index) descr(51,index) descr(52,index) descr(53,index) descr(54,index) descr(55,index) descr(56,index)...
    descr(57,index) descr(58,index) descr(59,index) descr(60,index) descr(61,index) descr(62,index) descr(63,index) descr(64,index)...
    descr(65,index) descr(66,index) descr(67,index) descr(68,index) descr(69,index) descr(70,index) descr(71,index) descr(72,index)...
    descr(73,index) descr(74,index) descr(75,index) descr(76,index) descr(77,index) descr(78,index) descr(79,index) descr(80,index)...
    descr(81,index) descr(82,index) descr(83,index) descr(84,index) descr(85,index) descr(86,index) descr(87,index) descr(88,index)...
    descr(89,index) descr(90,index) descr(91,index) descr(92,index) descr(93,index) descr(94,index) descr(95,index) descr(96,index)...
    descr(97,index) descr(98,index) descr(99,index) descr(100,index) descr(101,index) descr(102,index) descr(103,index) descr(104,index)...
    descr(105,index) descr(106,index) descr(107,index) descr(108,index) descr(109,index) descr(110,index) descr(111,index) descr(112,index)...
    descr(113,index) descr(114,index) descr(115,index) descr(116,index) descr(117,index) descr(118,index) descr(119,index) descr(120,index)...
    descr(121,index) descr(122,index) descr(123,index) descr(124,index) descr(125,index) descr(126,index) descr(127,index) descr(128,index)
    ]);
    commit(conn);
end
close(conn);
end

